import { ref} from "vue";
import store from "@/store";
export const useLoading = () => {
  const isLoading = ref(false);

  const startLoading = () => {
    isLoading.value = true;
    console.log(store,'99');
    
    store.commit('SET_LOADING',isLoading.value)
  };

  const finishLoading = () => {
    isLoading.value = false;
    store.commit('SET_LOADING',isLoading.value)
  };

  return { isLoading, startLoading, finishLoading };
};
